﻿function getSelectDishesList(dataList) {
    webPB.close();
    orderManager.delAllCacheData();
    for (var i = 0, len = dataList.length; i < len; i++) {
        var cacheDishes = {}; //ie must 
        Object.extend(cacheDishes, dataList[i], true)
        orderManager.addDataToCache(cacheDishes);
    }
}

jDoc("txt_CallerID").value = "13455667788";
document.onkeydown = function() {
    var oEvent = jDoc.getEvent();
    var keyCode = oEvent.keyCode;
    if (keyCode == 112 || keyCode == 113) {
        if (keyCode == 112) {
            var postData = { callerId: jDoc("txt_CallerID").value.trim() };
            $.post("Order/GetUserInfo.ashx", postData
                , function(data) {
                    if (data.success) {
                        var userInfo = data.obj["userInfo"];
                        var addressList = data.obj["addressList"];
                        jDoc("txt_UserId").value = userInfo.userId;
                        orderManager.callerAddrList = addressList;
                        orderManager.showUserAddress();
                    } else {
                        alert("无客户信息");
                    }

                }, "json");
        }
        oEvent.preventDefault();
        return false;
    }
}

function getNoticeList() {
    var postData = { t: 4 };
    postData.id = jDoc("div_NoticeList").getAttribute("data-lastid");
    $.post("/Order/GetDataList.ashx", postData,
        function(data) {
            var notice = jDoc("div_NoticeList");
            var lastId = 0;
            for (var i = 0, len = data.obj.length; i < len; i++) {
                lastId = data.obj[i]["id"];
                var ul = document.createElement("div");
                var html = [];
                html.push("<lable>");
                html.push("发布人:");
                html.push(data.obj[i]["publisher"]);
                html.push("<br/>发布时间:");
                html.push(data.obj[i]["createDate"]);
                html.push("<br/>级别:");
                html.push(data.obj[i]["levelName"]);
                html.push("</lable>");
                html.push("<div>内容：");
                html.push(data.obj[i]["content"]);
                html.push("</div>");
                html.push("------------------------");
                ul.innerHTML = html.join("");
                notice.appendChild(ul);
            }
            notice.setAttribute("data-lastid", lastId);
        }, "json");
}

